package com.qxglxt.qxgl.dao;

import javax.transaction.Transactional;

import com.qxglxt.qxgl.model.Users;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface IUsersDao extends JpaRepository<Users, Integer>, JpaSpecificationExecutor<Users> {
    @Transactional
    @Modifying
    @Query("update Users u set u.PassWord='ysd123' where u.id=:id")
    int pwdReset(Integer id);

    @Transactional
    @Modifying
    @Query("update Users u set u.IsLockout='是' where u.id=:id")
    int lockoutUser(Integer id);

    @Transactional
    @Modifying
    @Query("update Users u set u.IsLockout='否' where u.id=:id")
    int notLockoutUser(Integer id);
}